<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>奖惩管理</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css">
<style type="text/css">
	a{
		text-decoration:none;
	}
	ul li{
		list-style: none;
	}
	#add-rsaps{
		color: #19AA8D;
		border:1px solid #1AB394;
	}
	.bianji-neirong{
		margin:10px 10px 0px 0px;
		text-align: center;
	}
	.anniu{
		text-align: center;
	}
	/* 	奖惩信息表格里面的查看 */	
	.rsaps-ck{
		color: #19AA8D;
		border:1px solid #1AB394;
	}
</style>
</head>
<body>
<script type="text/javascript">
	function addrsaps(rsaps_id){
		alert(rsaps_id);
		$("#rsapsform").form('load',"ljj-rsapadd?rsaps_id="+rsaps_id);
		$("#content-admin").panel('open').panel('refresh','ljj-rsapsadd');
	}
	$(function(){
		var time=new Date();
		var timestamp = time.getYear()+""+time.getMonth()+""+time.getHours()+""+time.getSeconds();
		$("#rsaps_id").val(timestamp.substring(0,timestamp.length-1));
		$('#raps-table').datagrid({
		    url:'rsaps-list',
		    columns:[[
				{field:'rsaps_id',title:'奖惩编号',width:100,align:'center'},
				{field:'staffId',title:'员工工号',width:150,align:'center'},
				{field:'staff_name',title:'员工名称',width:150,align:'center'},
				{field:'rsapsExetime',title:'执行时间',width:150,align:'center'},
				{field:'rsapsTypes',title:'奖惩原因',width:150,align:'center'},
				{field:'rsaps_Result',title:'奖惩结果',width:150,align:'center'},
				{field:'caozuo',title:'操作',width:250,align:'center',
					formatter: function(value,row,index){
						return "<input type='button' onclick='addrsaps("+row['rsaps_id']+")' style='width: 45px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='查看'/>";
					},
				}
		    ]],
		    pagination:true,
		    pageNumber:1,
		    pageSize:2,
		    pageList:[2,10,15]
		});
			$("#add-rsaps").click(function(){
				$("#rsaps-aa").window("open"); 
				$("#rsaps-gb").linkbutton({onClick : function(){
					$("#rsaps-aa").window("close");
				}});
			});
			
			$("#rsaps-qianding").click(function(){
				alert(123);
				$("#rsapsform").submit();
				$("#rsapsforms").form("clear")
				$("#rsaps-aa").window("close");
			});
	});
	//条件查询之后的
	function qs(staff_name,name){
		alert(staff_name);
		$("#raps-table").datagrid({
    		url:'select-likersaps',
    		queryParams:{
    			staff_name:staff_name
    			
    		},
	    	 columns:[[
	    			{field:'rsaps_id',title:'奖惩编号',width:100,align:'center'},
	    			{field:'staffId',title:'员工工号',width:150,align:'center'},
	    			{field:'staff_name',title:'员工名称',width:150,align:'center'},
	    			{field:'rsapsExetime',title:'执行时间',width:150,align:'center'},
	    			{field:'rsapsTypes',title:'奖惩原因',width:150,align:'center'},
	    			{field:'rsaps_Result',title:'奖惩结果',width:150,align:'center'},
	    			{field:'caozuo',title:'操作',width:250,align:'center',
	    				formatter: function(value,row,index){
	    					return "<input type='button' onclick='addrsaps("+row['rsaps_id']+")' style='width: 45px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='查看'/>";
	    				},
	    			}
	    		]],
    		    pagination:true,
    		    pageNumber:1,
    		    pageSize:2,
    		    pageList:[2,10,15]
    	});
	}

</script>
	 <input id="zxrec" class="easyui-searchbox" style="width:300px"
	    data-options="searcher:qs,prompt:'根据员工工号,员工名称'"></input>
	<a id="add-rsaps" class="easyui-linkbutton" data-options="iconCls:'icon-add'">奖惩单</a>
	<table id="raps-table" class="easyui-datagrid" style="height: 560px">   
	</table>  
	<!-- 点击发起奖惩进入奖惩窗口 -->	
	<div id="rsaps-aa" class="easyui-window" title="奖惩单" style="width:800px;height:300px;" 
		data-options="modal:true,collapsible:false,minimizable:false,maximizable:false,closed:true,draggable:false">  
			<Form  action="insert-rsaps" id="rsapsform" method="post">
		        	<table width="600px" style="padding: 5px 5px 2px 3px;height:130px;">
		        		<tr>
		        			<td><input id="rsaps_id"  name="rsaps_id" class="easyui-textbox" data-options="label:'编号',width:280,labelAlign:'right',required:true"/></td>
		        			<td><select id="staff-name" class="easyui-combogrid" 
									name="staffId"
						    data-options="
						    	label:'奖惩员工',
						    	width:280,
						    	labelAlign:'right',
						    	required:true,
							    panelWidth:300,
							    idField:'staff_id',
							    textField:'staff_name',
							    url:'staffbg-list',
							    columns:[[
							    {field:'staff_id',title:'员工编号',width:80},
							    {field:'staff_name',title:'员工名称',width:160},
							    ]],
							    pagination:true,
				    		    pageNumber:1,
				    		    pageSize:2,
				    		    pageList:[3,5]
						    "></select></td>
		        		</tr>
		        		<tr>
		        			<td><input  name="rsapsExetime" class="easyui-datebox" data-options="label:'执行时间',width:280,labelAlign:'right',required:true,editable:false"/></td>
							<td><input  name="rsapsTypes" class="easyui-textbox" data-options="label:'奖惩原因',width:280,height:40,labelAlign:'right',required:true,multiline:true"/></td>
						</tr>
						<tr>
							<td><input  name="rsaps_Result" class="easyui-textbox" data-options="label:'奖惩结果',width:280,labelAlign:'right',required:true"/></td>
						</tr>
		        	</table>
		        	<div style="text-align: center;margin: 10px 1px 1px 1px">
					<a id="rsaps-gb" class="easyui-linkbutton" data-options="width:100">取消</a>
					<a id="rsaps-qianding"  class="easyui-linkbutton" data-options="width:100">确定</a>
					</div>
				 </Form>
</div>  
</body>
</html>